import { mysqlTable, mysqlSchema, AnyMySqlColumn, primaryKey, varchar, datetime, int, double, decimal, text, date, index, timestamp, tinyint, unique, longtext, bigint, foreignKey, smallint } from "drizzle-orm/mysql-core"
import { sql } from "drizzle-orm"

export const cesOrderCustomer = mysqlTable("ces_order_customer", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	sex: varchar({ length: 1 }),
	birthday: datetime({ mode: 'string'}),
	age: int(),
	address: varchar({ length: 300 }),
	orderMainId: varchar("order_main_id", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "ces_order_customer_id"}),
]);

export const cesOrderGoods = mysqlTable("ces_order_goods", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	goodName: varchar("good_name", { length: 32 }),
	price: double(),
	num: int(),
	zongPrice: double("zong_price"),
	orderMainId: varchar("order_main_id", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "ces_order_goods_id"}),
]);

export const cesOrderMain = mysqlTable("ces_order_main", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	orderCode: varchar("order_code", { length: 32 }),
	xdDate: datetime("xd_date", { mode: 'string'}),
	money: double(),
	remark: varchar({ length: 500 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "ces_order_main_id"}),
]);

export const cesShopGoods = mysqlTable("ces_shop_goods", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	price: decimal({ precision: 10, scale: 5 }),
	chucDate: datetime("chuc_date", { mode: 'string'}),
	contents: text(),
	goodTypeId: varchar("good_type_id", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "ces_shop_goods_id"}),
]);

export const cesShopType = mysqlTable("ces_shop_type", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	content: varchar({ length: 200 }),
	pics: varchar({ length: 500 }),
	pid: varchar({ length: 32 }),
	hasChild: varchar("has_child", { length: 3 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "ces_shop_type_id"}),
]);

export const demo = mysqlTable("demo", {
	id: varchar({ length: 50 }).notNull(),
	name: varchar({ length: 30 }),
	keyWord: varchar("key_word", { length: 255 }),
	punchTime: datetime("punch_time", { mode: 'string'}),
	salaryMoney: decimal("salary_money", { precision: 10, scale: 3 }),
	bonusMoney: double("bonus_money", { precision: 10, scale: 2 }),
	sex: varchar({ length: 2 }),
	age: int(),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	email: varchar({ length: 50 }),
	content: varchar({ length: 1000 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	tenantId: int("tenant_id").default(0),
	updateCount: int("update_count"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "demo_id"}),
]);

export const demoFieldDefValMain = mysqlTable("demo_field_def_val_main", {
	id: varchar({ length: 36 }).notNull(),
	code: varchar({ length: 200 }),
	name: varchar({ length: 200 }),
	sex: varchar({ length: 200 }),
	address: varchar({ length: 200 }),
	addressParam: varchar("address_param", { length: 32 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "demo_field_def_val_main_id"}),
]);

export const demoFieldDefValSub = mysqlTable("demo_field_def_val_sub", {
	id: varchar({ length: 36 }).notNull(),
	code: varchar({ length: 200 }),
	name: varchar({ length: 200 }),
	date: varchar({ length: 200 }),
	mainId: varchar("main_id", { length: 200 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "demo_field_def_val_sub_id"}),
]);

export const flywaySchemaHistory = mysqlTable("flyway_schema_history", {
	installedRank: int("installed_rank").notNull(),
	version: varchar({ length: 50 }),
	description: varchar({ length: 200 }).notNull(),
	type: varchar({ length: 20 }).notNull(),
	script: varchar({ length: 1000 }).notNull(),
	checksum: int(),
	installedBy: varchar("installed_by", { length: 100 }).notNull(),
	installedOn: timestamp("installed_on", { mode: 'string' }).default(sql`(now())`).notNull(),
	executionTime: int("execution_time").notNull(),
	success: tinyint().notNull(),
},
(table) => [
	index("flyway_schema_history_s_idx").on(table.success),
	primaryKey({ columns: [table.installedRank], name: "flyway_schema_history_installed_rank"}),
]);

export const jeecgMonthlyGrowthAnalysis = mysqlTable("jeecg_monthly_growth_analysis", {
	id: int().autoincrement().notNull(),
	year: varchar({ length: 50 }),
	month: varchar({ length: 50 }),
	mainIncome: decimal("main_income", { precision: 18, scale: 2 }).default('0.00'),
	otherIncome: decimal("other_income", { precision: 18, scale: 2 }).default('0.00'),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jeecg_monthly_growth_analysis_id"}),
]);

export const jeecgOrderCustomer = mysqlTable("jeecg_order_customer", {
	id: varchar({ length: 32 }).notNull(),
	name: varchar({ length: 100 }).notNull(),
	sex: varchar({ length: 4 }),
	idcard: varchar({ length: 18 }),
	idcardPic: varchar("idcard_pic", { length: 500 }),
	telphone: varchar({ length: 32 }),
	orderId: varchar("order_id", { length: 32 }).notNull(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jeecg_order_customer_id"}),
]);

export const jeecgOrderMain = mysqlTable("jeecg_order_main", {
	id: varchar({ length: 32 }).notNull(),
	orderCode: varchar("order_code", { length: 50 }),
	ctype: varchar({ length: 500 }),
	orderDate: datetime("order_date", { mode: 'string'}),
	orderMoney: double("order_money", { precision: 10, scale: 3 }),
	content: varchar({ length: 500 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	bpmStatus: varchar("bpm_status", { length: 3 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jeecg_order_main_id"}),
]);

export const jeecgOrderTicket = mysqlTable("jeecg_order_ticket", {
	id: varchar({ length: 32 }).notNull(),
	ticketCode: varchar("ticket_code", { length: 100 }).notNull(),
	tickectDate: datetime("tickect_date", { mode: 'string'}),
	orderId: varchar("order_id", { length: 32 }).notNull(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jeecg_order_ticket_id"}),
]);

export const jeecgProjectNatureIncome = mysqlTable("jeecg_project_nature_income", {
	id: int().autoincrement().notNull(),
	nature: varchar({ length: 50 }).notNull(),
	insuranceFee: decimal("insurance_fee", { precision: 18, scale: 2 }).default('0.00'),
	riskConsultingFee: decimal("risk_consulting_fee", { precision: 18, scale: 2 }).default('0.00'),
	evaluationFee: decimal("evaluation_fee", { precision: 18, scale: 2 }).default('0.00'),
	insuranceEvaluationFee: decimal("insurance_evaluation_fee", { precision: 18, scale: 2 }).default('0.00'),
	biddingConsultingFee: decimal("bidding_consulting_fee", { precision: 18, scale: 2 }).default('0.00'),
	interolConsultingFee: decimal("interol_consulting_fee", { precision: 18, scale: 2 }).default('0.00'),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jeecg_project_nature_income_id"}),
]);

export const jimuDict = mysqlTable("jimu_dict", {
	id: varchar({ length: 32 }).notNull(),
	dictName: varchar("dict_name", { length: 100 }).notNull(),
	dictCode: varchar("dict_code", { length: 100 }).notNull(),
	description: varchar({ length: 255 }),
	delFlag: int("del_flag"),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	type: int().default(0),
	tenantId: varchar("tenant_id", { length: 10 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jimu_dict_id"}),
	unique("uk_sd_dict_code").on(table.dictCode),
]);

export const jimuDictItem = mysqlTable("jimu_dict_item", {
	id: varchar({ length: 32 }).notNull(),
	dictId: varchar("dict_id", { length: 32 }),
	itemText: varchar("item_text", { length: 100 }).notNull(),
	itemValue: varchar("item_value", { length: 100 }).notNull(),
	description: varchar({ length: 255 }),
	sortOrder: int("sort_order"),
	status: int(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_sdi_role_dict_id").on(table.dictId),
	index("idx_sdi_role_sort_order").on(table.sortOrder),
	index("idx_sdi_status").on(table.status),
	index("idx_sdi_dict_val").on(table.dictId, table.itemValue),
	primaryKey({ columns: [table.id], name: "jimu_dict_item_id"}),
]);

export const jimuReport = mysqlTable("jimu_report", {
	id: varchar({ length: 32 }).notNull(),
	code: varchar({ length: 50 }),
	name: varchar({ length: 50 }),
	note: varchar({ length: 255 }),
	status: varchar({ length: 10 }),
	type: varchar({ length: 50 }),
	jsonStr: longtext("json_str"),
	apiUrl: varchar("api_url", { length: 255 }),
	thumb: text(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	delFlag: tinyint("del_flag"),
	apiMethod: varchar("api_method", { length: 255 }),
	apiCode: varchar("api_code", { length: 255 }),
	template: tinyint(),
	viewCount: bigint("view_count", { mode: "number" }),
	cssStr: text("css_str"),
	jsStr: text("js_str"),
	pyStr: text("py_str"),
	tenantId: varchar("tenant_id", { length: 10 }),
	updateCount: int("update_count").default(0),
	submitForm: tinyint("submit_form"),
},
(table) => [
	index("uniq_jmreport_createby").on(table.createBy),
	index("uniq_jmreport_delflag").on(table.delFlag),
	primaryKey({ columns: [table.id], name: "jimu_report_id"}),
	unique("uniq_jmreport_code").on(table.code),
]);

export const jimuReportCategory = mysqlTable("jimu_report_category", {
	id: varchar({ length: 32 }).notNull(),
	name: varchar({ length: 100 }).notNull(),
	parentId: varchar("parent_id", { length: 32 }),
	izLeaf: int("iz_leaf"),
	sourceType: varchar("source_type", { length: 10 }),
	delFlag: int("del_flag"),
	createBy: varchar("create_by", { length: 32 }),
	createTime: timestamp("create_time", { mode: 'string' }),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: timestamp("update_time", { mode: 'string' }),
	tenantId: varchar("tenant_id", { length: 11 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jimu_report_category_id"}),
]);

export const jimuReportDataSource = mysqlTable("jimu_report_data_source", {
	id: varchar({ length: 36 }).notNull(),
	name: varchar({ length: 100 }),
	reportId: varchar("report_id", { length: 100 }),
	code: varchar({ length: 100 }),
	remark: varchar({ length: 200 }),
	dbType: varchar("db_type", { length: 10 }),
	dbDriver: varchar("db_driver", { length: 100 }),
	dbUrl: varchar("db_url", { length: 500 }),
	dbUsername: varchar("db_username", { length: 100 }),
	dbPassword: varchar("db_password", { length: 100 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	connectTimes: int("connect_times").default(0),
	tenantId: varchar("tenant_id", { length: 10 }),
	type: varchar({ length: 10 }),
},
(table) => [
	index("idx_jmdatasource_report_id").on(table.reportId),
	index("idx_jmdatasource_code").on(table.code),
	primaryKey({ columns: [table.id], name: "jimu_report_data_source_id"}),
]);

export const jimuReportDb = mysqlTable("jimu_report_db", {
	id: varchar({ length: 36 }).notNull(),
	jimuReportId: varchar("jimu_report_id", { length: 32 }),
	createBy: varchar("create_by", { length: 50 }),
	updateBy: varchar("update_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateTime: datetime("update_time", { mode: 'string'}),
	dbCode: varchar("db_code", { length: 32 }),
	dbChName: varchar("db_ch_name", { length: 50 }),
	dbType: varchar("db_type", { length: 32 }),
	dbTableName: varchar("db_table_name", { length: 32 }),
	dbDynSql: longtext("db_dyn_sql"),
	dbKey: varchar("db_key", { length: 32 }),
	tbDbKey: varchar("tb_db_key", { length: 32 }),
	tbDbTableName: varchar("tb_db_table_name", { length: 32 }),
	javaType: varchar("java_type", { length: 32 }),
	javaValue: varchar("java_value", { length: 255 }),
	apiUrl: varchar("api_url", { length: 255 }),
	apiMethod: varchar("api_method", { length: 255 }),
	isList: varchar("is_list", { length: 10 }).default('0'),
	isPage: varchar("is_page", { length: 10 }),
	dbSource: varchar("db_source", { length: 255 }),
	dbSourceType: varchar("db_source_type", { length: 50 }),
	jsonData: text("json_data"),
	apiConvert: varchar("api_convert", { length: 255 }),
},
(table) => [
	index("idx_jmreportdb_db_key").on(table.dbKey),
	index("idx_jimu_report_id").on(table.jimuReportId),
	index("idx_db_source_id").on(table.dbSource),
	primaryKey({ columns: [table.id], name: "jimu_report_db_id"}),
]);

export const jimuReportDbField = mysqlTable("jimu_report_db_field", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	jimuReportDbId: varchar("jimu_report_db_id", { length: 32 }),
	fieldName: varchar("field_name", { length: 80 }),
	fieldText: varchar("field_text", { length: 50 }),
	widgetType: varchar("widget_type", { length: 50 }),
	widgetWidth: int("widget_width"),
	orderNum: int("order_num"),
	searchFlag: int("search_flag").default(0),
	searchMode: int("search_mode"),
	dictCode: varchar("dict_code", { length: 255 }),
	searchValue: varchar("search_value", { length: 100 }),
	searchFormat: varchar("search_format", { length: 50 }),
	extJson: text("ext_json"),
},
(table) => [
	index("idx_jrdf_jimu_report_db_id").on(table.jimuReportDbId),
	index("idx_dbfield_order_num").on(table.orderNum),
	primaryKey({ columns: [table.id], name: "jimu_report_db_field_id"}),
]);

export const jimuReportDbParam = mysqlTable("jimu_report_db_param", {
	id: varchar({ length: 36 }).notNull(),
	jimuReportHeadId: varchar("jimu_report_head_id", { length: 36 }).notNull(),
	paramName: varchar("param_name", { length: 32 }).notNull(),
	paramTxt: varchar("param_txt", { length: 32 }),
	paramValue: varchar("param_value", { length: 1000 }),
	orderNum: int("order_num"),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	searchFlag: int("search_flag"),
	widgetType: varchar("widget_type", { length: 50 }),
	searchMode: int("search_mode"),
	dictCode: varchar("dict_code", { length: 255 }),
	searchFormat: varchar("search_format", { length: 50 }),
	extJson: text("ext_json"),
},
(table) => [
	index("idx_jrdp_jimu_report_head_id").on(table.jimuReportHeadId),
	primaryKey({ columns: [table.id], name: "jimu_report_db_param_id"}),
]);

export const jimuReportExportLog = mysqlTable("jimu_report_export_log", {
	id: varchar({ length: 32 }).notNull(),
	batchNo: varchar("batch_no", { length: 50 }),
	exportChannel: varchar("export_channel", { length: 20 }),
	exportType: varchar("export_type", { length: 10 }),
	reportId: text("report_id"),
	downloadPath: varchar("download_path", { length: 255 }),
	status: varchar({ length: 15 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateTime: datetime("update_time", { mode: 'string'}),
	tenantId: varchar("tenant_id", { length: 10 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jimu_report_export_log_id"}),
]);

export const jimuReportLink = mysqlTable("jimu_report_link", {
	id: varchar({ length: 32 }).notNull(),
	reportId: varchar("report_id", { length: 32 }),
	parameter: text(),
	ejectType: varchar("eject_type", { length: 1 }),
	linkName: varchar("link_name", { length: 255 }),
	apiMethod: varchar("api_method", { length: 1 }),
	linkType: varchar("link_type", { length: 1 }),
	apiUrl: varchar("api_url", { length: 1000 }),
	linkChartId: varchar("link_chart_id", { length: 50 }),
	expression: varchar({ length: 255 }),
	requirement: varchar({ length: 255 }),
},
(table) => [
	index("uniq_link_reportid").on(table.reportId),
	primaryKey({ columns: [table.id], name: "jimu_report_link_id"}),
]);

export const jimuReportMap = mysqlTable("jimu_report_map", {
	id: varchar({ length: 64 }).notNull(),
	label: varchar({ length: 125 }),
	name: varchar({ length: 125 }),
	data: longtext(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	delFlag: varchar("del_flag", { length: 1 }),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jimu_report_map_id"}),
	unique("uniq_jmreport_map_name").on(table.name),
]);

export const jimuReportShare = mysqlTable("jimu_report_share", {
	id: varchar({ length: 32 }).notNull(),
	reportId: varchar("report_id", { length: 32 }),
	previewUrl: varchar("preview_url", { length: 1000 }),
	previewLock: varchar("preview_lock", { length: 4 }),
	lastUpdateTime: datetime("last_update_time", { mode: 'string'}),
	termOfValidity: varchar("term_of_validity", { length: 1 }),
	status: varchar({ length: 1 }),
	previewLockStatus: varchar("preview_lock_status", { length: 1 }),
	shareToken: varchar("share_token", { length: 50 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "jimu_report_share_id"}),
	unique("uniq_report_id").on(table.reportId),
	unique("uniq_jrs_report_id").on(table.reportId),
	unique("uniq_jrs_share_token").on(table.shareToken),
]);

export const joaDemo = mysqlTable("joa_demo", {
	id: varchar({ length: 32 }),
	name: varchar({ length: 100 }),
	days: int(),
	beginDate: datetime("begin_date", { mode: 'string'}),
	endDate: datetime("end_date", { mode: 'string'}),
	reason: varchar({ length: 500 }),
	bpmStatus: varchar("bpm_status", { length: 50 }).default('1'),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateTime: datetime("update_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
});

export const oauth2RegisteredClient = mysqlTable("oauth2_registered_client", {
	id: varchar({ length: 100 }).notNull(),
	clientId: varchar("client_id", { length: 100 }).notNull(),
	clientIdIssuedAt: timestamp("client_id_issued_at", { mode: 'string' }).default(sql`(now())`).notNull(),
	clientSecret: varchar("client_secret", { length: 200 }),
	clientSecretExpiresAt: timestamp("client_secret_expires_at", { mode: 'string' }),
	clientName: varchar("client_name", { length: 200 }).notNull(),
	clientAuthenticationMethods: varchar("client_authentication_methods", { length: 1000 }).notNull(),
	authorizationGrantTypes: varchar("authorization_grant_types", { length: 1000 }).notNull(),
	redirectUris: varchar("redirect_uris", { length: 1000 }),
	postLogoutRedirectUris: varchar("post_logout_redirect_uris", { length: 1000 }),
	scopes: varchar({ length: 1000 }).notNull(),
	clientSettings: varchar("client_settings", { length: 2000 }).notNull(),
	tokenSettings: varchar("token_settings", { length: 2000 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.id], name: "oauth2_registered_client_id"}),
]);

export const onlAuthData = mysqlTable("onl_auth_data", {
	id: varchar({ length: 32 }).notNull(),
	cgformId: varchar("cgform_id", { length: 32 }),
	ruleName: varchar("rule_name", { length: 50 }),
	ruleColumn: varchar("rule_column", { length: 50 }),
	ruleOperator: varchar("rule_operator", { length: 50 }),
	ruleValue: varchar("rule_value", { length: 255 }),
	status: int(),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 50 }),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_auth_data_id"}),
]);

export const onlAuthPage = mysqlTable("onl_auth_page", {
	id: varchar({ length: 32 }).notNull(),
	cgformId: varchar("cgform_id", { length: 32 }),
	code: varchar({ length: 255 }),
	type: int(),
	control: int(),
	page: int(),
	status: int(),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_auth_page_id"}),
]);

export const onlAuthRelation = mysqlTable("onl_auth_relation", {
	id: varchar({ length: 32 }).notNull(),
	roleId: varchar("role_id", { length: 32 }),
	authId: varchar("auth_id", { length: 32 }),
	type: int(),
	cgformId: varchar("cgform_id", { length: 32 }),
	authMode: varchar("auth_mode", { length: 50 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_auth_relation_id"}),
]);

export const onlCgformButton = mysqlTable("onl_cgform_button", {
	id: varchar("ID", { length: 32 }).notNull(),
	buttonCode: varchar("BUTTON_CODE", { length: 50 }),
	buttonIcon: varchar("BUTTON_ICON", { length: 50 }),
	buttonName: varchar("BUTTON_NAME", { length: 50 }),
	buttonStatus: varchar("BUTTON_STATUS", { length: 2 }),
	buttonStyle: varchar("BUTTON_STYLE", { length: 20 }),
	exp: varchar("EXP", { length: 255 }),
	cgformHeadId: varchar("CGFORM_HEAD_ID", { length: 32 }),
	optType: varchar("OPT_TYPE", { length: 20 }),
	orderNum: int("ORDER_NUM"),
	optPosition: varchar("OPT_POSITION", { length: 3 }),
},
(table) => [
	index("idx_ocb_CGFORM_HEAD_ID").on(table.cgformHeadId),
	index("idx_ocb_BUTTON_CODE").on(table.buttonCode),
	index("idx_ocb_BUTTON_STATUS").on(table.buttonStatus),
	index("idx_ocb_ORDER_NUM").on(table.orderNum),
	primaryKey({ columns: [table.id], name: "onl_cgform_button_ID"}),
]);

export const onlCgformEnhanceJava = mysqlTable("onl_cgform_enhance_java", {
	id: varchar("ID", { length: 36 }).notNull(),
	buttonCode: varchar("BUTTON_CODE", { length: 32 }),
	cgJavaType: varchar("CG_JAVA_TYPE", { length: 32 }).notNull(),
	cgJavaValue: varchar("CG_JAVA_VALUE", { length: 200 }).notNull(),
	cgformHeadId: varchar("CGFORM_HEAD_ID", { length: 32 }).notNull(),
	activeStatus: varchar("ACTIVE_STATUS", { length: 2 }).default('1'),
	event: varchar("EVENT", { length: 10 }).default('end').notNull(),
},
(table) => [
	index("idx_ejava_cgform_head_id").on(table.cgformHeadId),
	index("idx_ocej_BUTTON_CODE").on(table.buttonCode),
	index("idx_ocej_ACTIVE_STATUS").on(table.activeStatus),
	primaryKey({ columns: [table.id], name: "onl_cgform_enhance_java_ID"}),
]);

export const onlCgformEnhanceJs = mysqlTable("onl_cgform_enhance_js", {
	id: varchar("ID", { length: 32 }).notNull(),
	cgJs: longtext("CG_JS"),
	cgJsType: varchar("CG_JS_TYPE", { length: 20 }),
	content: varchar("CONTENT", { length: 1000 }),
	cgformHeadId: varchar("CGFORM_HEAD_ID", { length: 32 }),
},
(table) => [
	index("idx_ejs_cgform_head_id").on(table.cgformHeadId),
	index("idx_ejs_cg_js_type").on(table.cgJsType),
	primaryKey({ columns: [table.id], name: "onl_cgform_enhance_js_ID"}),
]);

export const onlCgformEnhanceSql = mysqlTable("onl_cgform_enhance_sql", {
	id: varchar("ID", { length: 32 }).notNull(),
	buttonCode: varchar("BUTTON_CODE", { length: 50 }),
	cgbSql: longtext("CGB_SQL"),
	cgbSqlName: varchar("CGB_SQL_NAME", { length: 50 }),
	content: varchar("CONTENT", { length: 1000 }),
	cgformHeadId: varchar("CGFORM_HEAD_ID", { length: 32 }),
},
(table) => [
	index("idx_oces_CGFORM_HEAD_ID").on(table.cgformHeadId),
	primaryKey({ columns: [table.id], name: "onl_cgform_enhance_sql_ID"}),
]);

export const onlCgformField = mysqlTable("onl_cgform_field", {
	id: varchar({ length: 32 }).notNull(),
	cgformHeadId: varchar("cgform_head_id", { length: 32 }).notNull(),
	dbFieldName: varchar("db_field_name", { length: 32 }).notNull(),
	dbFieldTxt: varchar("db_field_txt", { length: 200 }),
	dbFieldNameOld: varchar("db_field_name_old", { length: 32 }),
	dbIsKey: tinyint("db_is_key"),
	dbIsNull: tinyint("db_is_null"),
	dbIsPersist: tinyint("db_is_persist"),
	dbType: varchar("db_type", { length: 32 }).notNull(),
	dbLength: int("db_length").notNull(),
	dbPointLength: int("db_point_length"),
	dbDefaultVal: varchar("db_default_val", { length: 20 }),
	dictField: varchar("dict_field", { length: 100 }),
	dictTable: varchar("dict_table", { length: 255 }),
	dictText: varchar("dict_text", { length: 100 }),
	fieldShowType: varchar("field_show_type", { length: 20 }),
	fieldHref: varchar("field_href", { length: 200 }),
	fieldLength: int("field_length"),
	fieldValidType: varchar("field_valid_type", { length: 300 }),
	fieldMustInput: varchar("field_must_input", { length: 2 }),
	fieldExtendJson: varchar("field_extend_json", { length: 500 }),
	fieldDefaultValue: varchar("field_default_value", { length: 100 }),
	isQuery: tinyint("is_query"),
	isShowForm: tinyint("is_show_form"),
	isShowList: tinyint("is_show_list"),
	isReadOnly: tinyint("is_read_only").default(0),
	queryMode: varchar("query_mode", { length: 10 }),
	mainTable: varchar("main_table", { length: 100 }),
	mainField: varchar("main_field", { length: 100 }),
	orderNum: int("order_num"),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 255 }),
	converter: varchar({ length: 255 }),
	queryDefVal: varchar("query_def_val", { length: 50 }),
	queryDictText: varchar("query_dict_text", { length: 100 }),
	queryDictField: varchar("query_dict_field", { length: 100 }),
	queryDictTable: varchar("query_dict_table", { length: 500 }),
	queryShowType: varchar("query_show_type", { length: 50 }),
	queryConfigFlag: varchar("query_config_flag", { length: 3 }),
	queryValidType: varchar("query_valid_type", { length: 50 }),
	queryMustInput: varchar("query_must_input", { length: 3 }),
	sortFlag: varchar("sort_flag", { length: 3 }),
},
(table) => [
	index("idx_ocf_cgform_head_id").on(table.cgformHeadId),
	primaryKey({ columns: [table.id], name: "onl_cgform_field_id"}),
]);

export const onlCgformHead = mysqlTable("onl_cgform_head", {
	id: varchar({ length: 32 }).notNull(),
	tableName: varchar("table_name", { length: 50 }).notNull(),
	tableType: int("table_type").notNull(),
	tableVersion: int("table_version").default(1),
	tableTxt: varchar("table_txt", { length: 200 }).notNull(),
	isCheckbox: varchar("is_checkbox", { length: 5 }).notNull(),
	isDbSynch: varchar("is_db_synch", { length: 20 }).default('N').notNull(),
	isPage: varchar("is_page", { length: 5 }).notNull(),
	isTree: varchar("is_tree", { length: 5 }).notNull(),
	idSequence: varchar("id_sequence", { length: 200 }),
	idType: varchar("id_type", { length: 100 }),
	queryMode: varchar("query_mode", { length: 10 }),
	relationType: int("relation_type"),
	subTableStr: varchar("sub_table_str", { length: 1000 }),
	tabOrderNum: int("tab_order_num"),
	treeParentIdField: varchar("tree_parent_id_field", { length: 50 }),
	treeIdField: varchar("tree_id_field", { length: 50 }),
	treeFieldname: varchar("tree_fieldname", { length: 50 }),
	formCategory: varchar("form_category", { length: 50 }).default('bdfl_ptbd').notNull(),
	formTemplate: varchar("form_template", { length: 50 }),
	formTemplateMobile: varchar("form_template_mobile", { length: 50 }),
	scroll: int().default(0),
	copyVersion: int("copy_version"),
	copyType: int("copy_type").default(0),
	physicId: varchar("physic_id", { length: 32 }),
	extConfigJson: varchar("ext_config_json", { length: 1000 }),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	themeTemplate: varchar("theme_template", { length: 50 }),
	isDesForm: varchar("is_des_form", { length: 2 }),
	desFormCode: varchar("des_form_code", { length: 50 }),
	lowAppId: varchar("low_app_id", { length: 32 }),
},
(table) => [
	index("idx_och_cgform_head_id").on(table.tableName),
	index("idx_och_table_name").on(table.formTemplate),
	index("idx_och_form_template_mobile").on(table.formTemplateMobile),
	index("idx_och_table_version").on(table.tableVersion),
	primaryKey({ columns: [table.id], name: "onl_cgform_head_id"}),
]);

export const onlCgformIndex = mysqlTable("onl_cgform_index", {
	id: varchar({ length: 36 }).notNull(),
	cgformHeadId: varchar("cgform_head_id", { length: 32 }),
	indexName: varchar("index_name", { length: 100 }),
	indexNameOld: varchar("index_name_old", { length: 100 }),
	indexField: varchar("index_field", { length: 500 }),
	indexType: varchar("index_type", { length: 32 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	isDbSynch: varchar("is_db_synch", { length: 2 }).default('N'),
	delFlag: int("del_flag").default(0),
},
(table) => [
	index("idx_oci_cgform_head_id").on(table.cgformHeadId),
	primaryKey({ columns: [table.id], name: "onl_cgform_index_id"}),
]);

export const onlCgreportHead = mysqlTable("onl_cgreport_head", {
	id: varchar({ length: 36 }).notNull(),
	code: varchar({ length: 100 }).notNull(),
	name: varchar({ length: 100 }).notNull(),
	cgrSql: varchar("cgr_sql", { length: 1000 }).notNull(),
	returnValField: varchar("return_val_field", { length: 100 }),
	returnTxtField: varchar("return_txt_field", { length: 100 }),
	returnType: varchar("return_type", { length: 2 }).default('1'),
	dbSource: varchar("db_source", { length: 100 }),
	content: varchar({ length: 1000 }),
	lowAppId: varchar("low_app_id", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_cgreport_head_id"}),
	unique("index_onlinereport_code").on(table.code),
]);

export const onlCgreportItem = mysqlTable("onl_cgreport_item", {
	id: varchar({ length: 36 }).notNull(),
	cgrheadId: varchar("cgrhead_id", { length: 36 }).notNull(),
	fieldName: varchar("field_name", { length: 36 }).notNull(),
	fieldTxt: varchar("field_txt", { length: 300 }),
	fieldWidth: int("field_width"),
	fieldType: varchar("field_type", { length: 10 }),
	searchMode: varchar("search_mode", { length: 10 }),
	isOrder: int("is_order").default(0),
	isSearch: int("is_search").default(0),
	dictCode: varchar("dict_code", { length: 500 }),
	fieldHref: varchar("field_href", { length: 120 }),
	isShow: int("is_show").default(1),
	orderNum: int("order_num"),
	replaceVal: varchar("replace_val", { length: 200 }),
	isTotal: varchar("is_total", { length: 2 }),
	groupTitle: varchar("group_title", { length: 50 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_oci_cgrhead_id").on(table.cgrheadId),
	index("idx_oci_is_show").on(table.isShow),
	index("idx_oci_order_num").on(table.orderNum),
	primaryKey({ columns: [table.id], name: "onl_cgreport_item_id"}),
]);

export const onlCgreportParam = mysqlTable("onl_cgreport_param", {
	id: varchar({ length: 36 }).notNull(),
	cgrheadId: varchar("cgrhead_id", { length: 36 }).notNull(),
	paramName: varchar("param_name", { length: 32 }).notNull(),
	paramTxt: varchar("param_txt", { length: 32 }),
	paramValue: varchar("param_value", { length: 32 }),
	orderNum: int("order_num"),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_ocp_cgrhead_id").on(table.cgrheadId),
	primaryKey({ columns: [table.id], name: "onl_cgreport_param_id"}),
]);

export const onlDragComp = mysqlTable("onl_drag_comp", {
	id: varchar({ length: 32 }).notNull(),
	parentId: varchar("parent_id", { length: 32 }),
	compName: varchar("comp_name", { length: 50 }),
	compType: varchar("comp_type", { length: 20 }),
	icon: varchar({ length: 50 }),
	orderNum: int("order_num"),
	typeId: int("type_id"),
	compConfig: longtext("comp_config"),
	status: varchar({ length: 2 }).default('0'),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_drag_comp_id"}),
]);

export const onlDragDatasetHead = mysqlTable("onl_drag_dataset_head", {
	id: varchar({ length: 32 }).notNull(),
	name: varchar({ length: 100 }).notNull(),
	code: varchar({ length: 36 }),
	parentId: varchar("parent_id", { length: 36 }),
	dbSource: varchar("db_source", { length: 100 }),
	querySql: varchar("query_sql", { length: 5000 }).default('0'),
	content: varchar({ length: 1000 }),
	izAgent: varchar("iz_agent", { length: 10 }).default('0'),
	dataType: varchar("data_type", { length: 50 }),
	apiMethod: varchar("api_method", { length: 10 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	lowAppId: varchar("low_app_id", { length: 32 }),
	tenantId: int("tenant_id"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_drag_dataset_head_id"}),
]);

export const onlDragDatasetItem = mysqlTable("onl_drag_dataset_item", {
	id: varchar({ length: 32 }).notNull(),
	headId: varchar("head_id", { length: 36 }).notNull(),
	fieldName: varchar("field_name", { length: 36 }),
	fieldTxt: varchar("field_txt", { length: 1000 }),
	fieldType: varchar("field_type", { length: 10 }),
	widgetType: varchar("widget_type", { length: 30 }),
	dictCode: varchar("dict_code", { length: 500 }),
	dictTable: varchar("dict_table", { length: 125 }),
	dictText: varchar("dict_text", { length: 125 }),
	izShow: varchar("iz_show", { length: 5 }),
	izSearch: varchar("iz_search", { length: 10 }),
	izTotal: varchar("iz_total", { length: 5 }),
	searchMode: varchar("search_mode", { length: 10 }),
	orderNum: int("order_num"),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_oddi_head_id").on(table.headId),
	primaryKey({ columns: [table.id], name: "onl_drag_dataset_item_id"}),
]);

export const onlDragDatasetParam = mysqlTable("onl_drag_dataset_param", {
	id: varchar({ length: 36 }).notNull(),
	headId: varchar("head_id", { length: 36 }).notNull(),
	paramName: varchar("param_name", { length: 32 }).notNull(),
	paramTxt: varchar("param_txt", { length: 32 }),
	paramValue: varchar("param_value", { length: 1000 }),
	orderNum: int("order_num"),
	izSearch: int("iz_search"),
	widgetType: varchar("widget_type", { length: 50 }),
	searchMode: int("search_mode"),
	dictCode: varchar("dict_code", { length: 255 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_oddp_head_id").on(table.headId),
	primaryKey({ columns: [table.id], name: "onl_drag_dataset_param_id"}),
]);

export const onlDragPage = mysqlTable("onl_drag_page", {
	id: varchar({ length: 50 }).notNull(),
	name: varchar({ length: 100 }),
	path: varchar({ length: 100 }),
	backgroundColor: varchar("background_color", { length: 10 }),
	backgroundImage: varchar("background_image", { length: 255 }),
	designType: int("design_type"),
	theme: varchar({ length: 10 }),
	style: varchar({ length: 20 }),
	coverUrl: varchar("cover_url", { length: 500 }),
	template: longtext(),
	protectionCode: varchar("protection_code", { length: 32 }),
	type: varchar({ length: 64 }),
	izTemplate: varchar("iz_template", { length: 10 }).default('0'),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	lowAppId: varchar("low_app_id", { length: 50 }),
	tenantId: int("tenant_id"),
	updateCount: int("update_count").default(1),
	visitsNum: int("visits_num"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_drag_page_id"}),
]);

export const onlDragPageComp = mysqlTable("onl_drag_page_comp", {
	id: varchar({ length: 32 }).notNull(),
	parentId: varchar("parent_id", { length: 32 }),
	pageId: varchar("page_Id", { length: 50 }),
	compId: varchar("comp_id", { length: 32 }),
	component: varchar({ length: 50 }),
	config: longtext(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "onl_drag_page_comp_id"}),
]);

export const onlDragTableRelation = mysqlTable("onl_drag_table_relation", {
	id: varchar({ length: 50 }).notNull(),
	aggregationName: varchar("aggregation_name", { length: 100 }),
	aggregationDesc: varchar("aggregation_desc", { length: 100 }),
	relationForms: longtext("relation_forms"),
	filterCondition: longtext("filter_condition"),
	headerFields: longtext("header_fields"),
	calculateFields: longtext("calculate_fields"),
	validateInfo: longtext("validate_info"),
	delFlag: tinyint("del_flag"),
	lowAppId: varchar("low_app_id", { length: 50 }),
	tenantId: int("tenant_id"),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_aggregation_name").on(table.aggregationName),
	index("idx_del_flag").on(table.delFlag),
	index("idx_tenant_id").on(table.tenantId),
	index("idx_create_by").on(table.createBy),
	primaryKey({ columns: [table.id], name: "onl_drag_table_relation_id"}),
]);

export const ossFile = mysqlTable("oss_file", {
	id: varchar({ length: 32 }).notNull(),
	fileName: varchar("file_name", { length: 255 }),
	url: varchar({ length: 1000 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "oss_file_id"}),
]);

export const qingjiaDan = mysqlTable("qingjia_dan", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	sex: varchar({ length: 32 }),
	age: int(),
	descc: varchar({ length: 1000 }),
	days: int(),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	beDate: date("be_date", { mode: 'string' }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	endDate: date("end_date", { mode: 'string' }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "qingjia_dan_id"}),
]);

export const qrtzBlobTriggers = mysqlTable("qrtz_blob_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
},
(table) => [
	foreignKey({
			columns: [table.schedName, table.triggerName, table.triggerGroup],
			foreignColumns: [qrtzTriggers.schedName, qrtzTriggers.triggerName, qrtzTriggers.triggerGroup],
			name: "qrtz_blob_triggers_ibfk_1"
		}).onUpdate("restrict").onDelete("restrict"),
	primaryKey({ columns: [table.schedName, table.triggerName, table.triggerGroup], name: "qrtz_blob_triggers_SCHED_NAME_TRIGGER_NAME_TRIGGER_GROUP"}),
]);

export const qrtzCalendars = mysqlTable("qrtz_calendars", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	calendarName: varchar("CALENDAR_NAME", { length: 200 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.calendarName], name: "qrtz_calendars_SCHED_NAME_CALENDAR_NAME"}),
]);

export const qrtzCronTriggers = mysqlTable("qrtz_cron_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
	cronExpression: varchar("CRON_EXPRESSION", { length: 200 }).notNull(),
	timeZoneId: varchar("TIME_ZONE_ID", { length: 80 }),
},
(table) => [
	foreignKey({
			columns: [table.schedName, table.triggerName, table.triggerGroup],
			foreignColumns: [qrtzTriggers.schedName, qrtzTriggers.triggerName, qrtzTriggers.triggerGroup],
			name: "qrtz_cron_triggers_ibfk_1"
		}).onUpdate("restrict").onDelete("restrict"),
	primaryKey({ columns: [table.schedName, table.triggerName, table.triggerGroup], name: "qrtz_cron_triggers_SCHED_NAME_TRIGGER_NAME_TRIGGER_GROUP"}),
]);

export const qrtzFiredTriggers = mysqlTable("qrtz_fired_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	entryId: varchar("ENTRY_ID", { length: 95 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
	instanceName: varchar("INSTANCE_NAME", { length: 200 }).notNull(),
	firedTime: bigint("FIRED_TIME", { mode: "number" }).notNull(),
	schedTime: bigint("SCHED_TIME", { mode: "number" }).notNull(),
	priority: int("PRIORITY").notNull(),
	state: varchar("STATE", { length: 16 }).notNull(),
	jobName: varchar("JOB_NAME", { length: 200 }),
	jobGroup: varchar("JOB_GROUP", { length: 200 }),
	isNonconcurrent: varchar("IS_NONCONCURRENT", { length: 1 }),
	requestsRecovery: varchar("REQUESTS_RECOVERY", { length: 1 }),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.entryId], name: "qrtz_fired_triggers_SCHED_NAME_ENTRY_ID"}),
]);

export const qrtzJobDetails = mysqlTable("qrtz_job_details", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	jobName: varchar("JOB_NAME", { length: 200 }).notNull(),
	jobGroup: varchar("JOB_GROUP", { length: 200 }).notNull(),
	description: varchar("DESCRIPTION", { length: 250 }),
	jobClassName: varchar("JOB_CLASS_NAME", { length: 250 }).notNull(),
	isDurable: varchar("IS_DURABLE", { length: 1 }).notNull(),
	isNonconcurrent: varchar("IS_NONCONCURRENT", { length: 1 }).notNull(),
	isUpdateData: varchar("IS_UPDATE_DATA", { length: 1 }).notNull(),
	requestsRecovery: varchar("REQUESTS_RECOVERY", { length: 1 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.jobName, table.jobGroup], name: "qrtz_job_details_SCHED_NAME_JOB_NAME_JOB_GROUP"}),
]);

export const qrtzLocks = mysqlTable("qrtz_locks", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	lockName: varchar("LOCK_NAME", { length: 40 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.lockName], name: "qrtz_locks_SCHED_NAME_LOCK_NAME"}),
]);

export const qrtzPausedTriggerGrps = mysqlTable("qrtz_paused_trigger_grps", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.triggerGroup], name: "qrtz_paused_trigger_grps_SCHED_NAME_TRIGGER_GROUP"}),
]);

export const qrtzSchedulerState = mysqlTable("qrtz_scheduler_state", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	instanceName: varchar("INSTANCE_NAME", { length: 200 }).notNull(),
	lastCheckinTime: bigint("LAST_CHECKIN_TIME", { mode: "number" }).notNull(),
	checkinInterval: bigint("CHECKIN_INTERVAL", { mode: "number" }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.schedName, table.instanceName], name: "qrtz_scheduler_state_SCHED_NAME_INSTANCE_NAME"}),
]);

export const qrtzSimpleTriggers = mysqlTable("qrtz_simple_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
	repeatCount: bigint("REPEAT_COUNT", { mode: "number" }).notNull(),
	repeatInterval: bigint("REPEAT_INTERVAL", { mode: "number" }).notNull(),
	timesTriggered: bigint("TIMES_TRIGGERED", { mode: "number" }).notNull(),
},
(table) => [
	foreignKey({
			columns: [table.schedName, table.triggerName, table.triggerGroup],
			foreignColumns: [qrtzTriggers.schedName, qrtzTriggers.triggerName, qrtzTriggers.triggerGroup],
			name: "qrtz_simple_triggers_ibfk_1"
		}).onUpdate("restrict").onDelete("restrict"),
	primaryKey({ columns: [table.schedName, table.triggerName, table.triggerGroup], name: "qrtz_simple_triggers_SCHED_NAME_TRIGGER_NAME_TRIGGER_GROUP"}),
]);

export const qrtzSimpropTriggers = mysqlTable("qrtz_simprop_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
	strProp1: varchar("STR_PROP_1", { length: 512 }),
	strProp2: varchar("STR_PROP_2", { length: 512 }),
	strProp3: varchar("STR_PROP_3", { length: 512 }),
	intProp1: int("INT_PROP_1"),
	intProp2: int("INT_PROP_2"),
	longProp1: bigint("LONG_PROP_1", { mode: "number" }),
	longProp2: bigint("LONG_PROP_2", { mode: "number" }),
	decProp1: decimal("DEC_PROP_1", { precision: 13, scale: 4 }),
	decProp2: decimal("DEC_PROP_2", { precision: 13, scale: 4 }),
	boolProp1: varchar("BOOL_PROP_1", { length: 1 }),
	boolProp2: varchar("BOOL_PROP_2", { length: 1 }),
},
(table) => [
	foreignKey({
			columns: [table.schedName, table.triggerName, table.triggerGroup],
			foreignColumns: [qrtzTriggers.schedName, qrtzTriggers.triggerName, qrtzTriggers.triggerGroup],
			name: "qrtz_simprop_triggers_ibfk_1"
		}).onUpdate("restrict").onDelete("restrict"),
	primaryKey({ columns: [table.schedName, table.triggerName, table.triggerGroup], name: "qrtz_simprop_triggers_SCHED_NAME_TRIGGER_NAME_TRIGGER_GROUP"}),
]);

export const qrtzTriggers = mysqlTable("qrtz_triggers", {
	schedName: varchar("SCHED_NAME", { length: 120 }).notNull(),
	triggerName: varchar("TRIGGER_NAME", { length: 200 }).notNull(),
	triggerGroup: varchar("TRIGGER_GROUP", { length: 200 }).notNull(),
	jobName: varchar("JOB_NAME", { length: 200 }).notNull(),
	jobGroup: varchar("JOB_GROUP", { length: 200 }).notNull(),
	description: varchar("DESCRIPTION", { length: 250 }),
	nextFireTime: bigint("NEXT_FIRE_TIME", { mode: "number" }),
	prevFireTime: bigint("PREV_FIRE_TIME", { mode: "number" }),
	priority: int("PRIORITY"),
	triggerState: varchar("TRIGGER_STATE", { length: 16 }).notNull(),
	triggerType: varchar("TRIGGER_TYPE", { length: 8 }).notNull(),
	startTime: bigint("START_TIME", { mode: "number" }).notNull(),
	endTime: bigint("END_TIME", { mode: "number" }),
	calendarName: varchar("CALENDAR_NAME", { length: 200 }),
	misfireInstr: smallint("MISFIRE_INSTR"),
},
(table) => [
	index("SCHED_NAME").on(table.schedName, table.jobName, table.jobGroup),
	foreignKey({
			columns: [table.schedName, table.jobName, table.jobGroup],
			foreignColumns: [qrtzJobDetails.schedName, qrtzJobDetails.jobName, qrtzJobDetails.jobGroup],
			name: "qrtz_triggers_ibfk_1"
		}).onUpdate("restrict").onDelete("restrict"),
	primaryKey({ columns: [table.schedName, table.triggerName, table.triggerGroup], name: "qrtz_triggers_SCHED_NAME_TRIGGER_NAME_TRIGGER_GROUP"}),
]);

export const repDemoDxtj = mysqlTable("rep_demo_dxtj", {
	id: varchar({ length: 32 }).notNull(),
	name: varchar({ length: 50 }),
	gtime: datetime({ mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	jphone: varchar({ length: 125 }),
	birth: datetime({ mode: 'string'}),
	hukou: varchar({ length: 32 }),
	laddress: varchar({ length: 125 }),
	jperson: varchar({ length: 32 }),
	sex: varchar({ length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_dxtj_id"}),
]);

export const repDemoEmployee = mysqlTable("rep_demo_employee", {
	id: varchar({ length: 10 }).notNull(),
	num: varchar({ length: 50 }),
	name: varchar({ length: 100 }),
	sex: varchar({ length: 10 }),
	birthday: datetime({ mode: 'string'}),
	nation: varchar({ length: 30 }),
	political: varchar({ length: 30 }),
	nativePlace: varchar("native_place", { length: 30 }),
	height: varchar({ length: 30 }),
	weight: varchar({ length: 30 }),
	health: varchar({ length: 30 }),
	idCard: varchar("id_card", { length: 80 }),
	education: varchar({ length: 30 }),
	school: varchar({ length: 80 }),
	major: varchar({ length: 80 }),
	address: varchar({ length: 100 }),
	zipCode: varchar("zip_code", { length: 30 }),
	email: varchar({ length: 30 }),
	phone: varchar({ length: 30 }),
	foreignLanguage: varchar("foreign_language", { length: 30 }),
	foreignLanguageLevel: varchar("foreign_language_level", { length: 30 }),
	computerLevel: varchar("computer_level", { length: 30 }),
	graduationTime: datetime("graduation_time", { mode: 'string'}),
	arrivalTime: datetime("arrival_time", { mode: 'string'}),
	positionalTitles: varchar("positional_titles", { length: 30 }),
	educationExperience: text("education_experience"),
	workExperience: text("work_experience"),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	delFlag: tinyint("del_flag"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_employee_id"}),
]);

export const repDemoGongsi = mysqlTable("rep_demo_gongsi", {
	id: int().autoincrement().notNull(),
	gname: varchar({ length: 125 }).notNull(),
	gdata: varchar({ length: 255 }).notNull(),
	tdata: varchar({ length: 125 }).notNull(),
	didian: varchar({ length: 255 }).notNull(),
	zhaiyao: varchar({ length: 255 }).notNull(),
	num: varchar({ length: 255 }).notNull(),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_gongsi_id"}),
]);

export const repDemoJianpiao = mysqlTable("rep_demo_jianpiao", {
	id: int().autoincrement().notNull(),
	bnum: varchar({ length: 125 }).notNull(),
	ftime: varchar({ length: 125 }).notNull(),
	sfkong: varchar({ length: 125 }).notNull(),
	kaishi: varchar({ length: 125 }).notNull(),
	jieshu: varchar({ length: 125 }).notNull(),
	hezairen: varchar({ length: 125 }).notNull(),
	jpnum: varchar({ length: 125 }).notNull(),
	shihelv: varchar({ length: 125 }).notNull(),
	sId: int("s_id").notNull(),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_jianpiao_id"}),
]);

export const repDemoOrderMain = mysqlTable("rep_demo_order_main", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	orderCode: varchar("order_code", { length: 32 }),
	orderDate: datetime("order_date", { mode: 'string'}),
	descc: varchar({ length: 100 }),
	xiala: varchar({ length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_order_main_id"}),
]);

export const repDemoOrderProduct = mysqlTable("rep_demo_order_product", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	productName: varchar("product_name", { length: 32 }),
	price: double({ precision: 32, scale: 0 }),
	num: int(),
	descc: varchar({ length: 32 }),
	orderFkId: varchar("order_fk_id", { length: 32 }).notNull(),
	proType: varchar("pro_type", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "rep_demo_order_product_id"}),
]);

export const sysAnnouncement = mysqlTable("sys_announcement", {
	id: varchar({ length: 32 }).notNull(),
	titile: varchar({ length: 100 }),
	msgContent: text("msg_content"),
	startTime: datetime("start_time", { mode: 'string'}),
	endTime: datetime("end_time", { mode: 'string'}),
	sender: varchar({ length: 100 }),
	priority: varchar({ length: 255 }),
	msgCategory: varchar("msg_category", { length: 10 }).default('2').notNull(),
	msgType: varchar("msg_type", { length: 10 }),
	sendStatus: varchar("send_status", { length: 10 }),
	sendTime: datetime("send_time", { mode: 'string'}),
	cancelTime: datetime("cancel_time", { mode: 'string'}),
	delFlag: varchar("del_flag", { length: 1 }),
	busType: varchar("bus_type", { length: 20 }),
	busId: varchar("bus_id", { length: 50 }),
	openType: varchar("open_type", { length: 20 }),
	openPage: varchar("open_page", { length: 255 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	userIds: text("user_ids"),
	msgAbstract: text("msg_abstract"),
	dtTaskId: varchar("dt_task_id", { length: 100 }),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	index("idx_sanno_endtime").on(table.endTime),
	index("idx_sanno_start_time").on(table.startTime),
	index("idx_sanno_msg_type").on(table.msgType),
	index("idx_sanno_send_status").on(table.sendStatus),
	index("idx_sanno_del_flag").on(table.delFlag),
	index("idx_sanno_tenant_id").on(table.tenantId),
	index("idx_sanno_sender").on(table.sender),
	index("idx_sanno_create_time").on(table.createTime),
	primaryKey({ columns: [table.id], name: "sys_announcement_id"}),
]);

export const sysAnnouncementSend = mysqlTable("sys_announcement_send", {
	id: varchar({ length: 32 }),
	anntId: varchar("annt_id", { length: 32 }),
	userId: varchar("user_id", { length: 32 }),
	readFlag: int("read_flag"),
	readTime: datetime("read_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	starFlag: varchar("star_flag", { length: 10 }),
},
(table) => [
	index("idx_sacm_annt_id").on(table.anntId),
	index("idx_sacm_user_id").on(table.userId),
	index("idx_sacm_read_flag").on(table.readFlag),
	index("idx_sacm_star_flag").on(table.starFlag),
]);

export const sysCategory = mysqlTable("sys_category", {
	id: varchar({ length: 36 }).notNull(),
	pid: varchar({ length: 36 }),
	name: varchar({ length: 100 }),
	code: varchar({ length: 100 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	hasChild: varchar("has_child", { length: 3 }),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_category_id"}),
	unique("index_scg_code").on(table.code),
]);

export const sysCheckRule = mysqlTable("sys_check_rule", {
	id: varchar({ length: 32 }).notNull(),
	ruleName: varchar("rule_name", { length: 100 }),
	ruleCode: varchar("rule_code", { length: 100 }),
	ruleJson: varchar("rule_json", { length: 1024 }),
	ruleDescription: varchar("rule_description", { length: 200 }),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_check_rule_id"}),
	unique("uk_scr_rule_code").on(table.ruleCode),
]);

export const sysComment = mysqlTable("sys_comment", {
	id: varchar({ length: 32 }).notNull(),
	tableName: varchar("table_name", { length: 50 }).notNull(),
	tableDataId: varchar("table_data_id", { length: 32 }).notNull(),
	fromUserId: varchar("from_user_id", { length: 32 }).notNull(),
	toUserId: varchar("to_user_id", { length: 32 }),
	commentId: varchar("comment_id", { length: 32 }),
	commentContent: varchar("comment_content", { length: 255 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_table_data_id").on(table.tableName, table.tableDataId),
	primaryKey({ columns: [table.id], name: "sys_comment_id"}),
]);

export const sysDataLog = mysqlTable("sys_data_log", {
	id: varchar({ length: 32 }).notNull(),
	createBy: varchar("create_by", { length: 32 }),
	createName: varchar("create_name", { length: 100 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	dataTable: varchar("data_table", { length: 200 }),
	dataId: varchar("data_id", { length: 32 }),
	dataContent: text("data_content"),
	dataVersion: int("data_version"),
	type: varchar({ length: 20 }).default('json'),
},
(table) => [
	index("idx_sdl_data_table_id").on(table.dataTable, table.dataId),
	primaryKey({ columns: [table.id], name: "sys_data_log_id"}),
]);

export const sysDataSource = mysqlTable("sys_data_source", {
	id: varchar({ length: 36 }).notNull(),
	code: varchar({ length: 100 }),
	name: varchar({ length: 100 }),
	remark: varchar({ length: 200 }),
	dbType: varchar("db_type", { length: 10 }),
	dbDriver: varchar("db_driver", { length: 100 }),
	dbUrl: varchar("db_url", { length: 500 }),
	dbName: varchar("db_name", { length: 100 }),
	dbUsername: varchar("db_username", { length: 100 }),
	dbPassword: varchar("db_password", { length: 100 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_data_source_id"}),
	unique("uk_sdc_rule_code").on(table.code),
]);

export const sysDepart = mysqlTable("sys_depart", {
	id: varchar({ length: 32 }).notNull(),
	parentId: varchar("parent_id", { length: 32 }),
	departName: varchar("depart_name", { length: 100 }).notNull(),
	departNameEn: varchar("depart_name_en", { length: 500 }),
	departNameAbbr: varchar("depart_name_abbr", { length: 500 }),
	departOrder: int("depart_order").default(0),
	description: varchar({ length: 500 }),
	orgCategory: varchar("org_category", { length: 10 }).default('1').notNull(),
	orgType: varchar("org_type", { length: 10 }),
	orgCode: varchar("org_code", { length: 64 }).notNull(),
	mobile: varchar({ length: 32 }),
	fax: varchar({ length: 32 }),
	address: varchar({ length: 100 }),
	memo: varchar({ length: 500 }),
	status: varchar({ length: 1 }),
	delFlag: varchar("del_flag", { length: 1 }),
	qywxIdentifier: varchar("qywx_identifier", { length: 100 }),
	dingIdentifier: varchar("ding_identifier", { length: 100 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	tenantId: int("tenant_id").default(0),
	izLeaf: tinyint("iz_leaf").default(0),
},
(table) => [
	index("idx_sd_parent_id").on(table.parentId),
	index("idx_sd_depart_order").on(table.departOrder),
	primaryKey({ columns: [table.id], name: "sys_depart_id"}),
	unique("uniq_depart_org_code").on(table.orgCode),
]);

export const sysDepartPermission = mysqlTable("sys_depart_permission", {
	id: varchar({ length: 32 }).notNull(),
	departId: varchar("depart_id", { length: 32 }),
	permissionId: varchar("permission_id", { length: 32 }),
	dataRuleIds: varchar("data_rule_ids", { length: 1000 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_depart_permission_id"}),
]);

export const sysDepartRole = mysqlTable("sys_depart_role", {
	id: varchar({ length: 32 }).notNull(),
	departId: varchar("depart_id", { length: 32 }),
	roleName: varchar("role_name", { length: 200 }),
	roleCode: varchar("role_code", { length: 100 }),
	description: varchar({ length: 255 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_depart_role_id"}),
]);

export const sysDepartRolePermission = mysqlTable("sys_depart_role_permission", {
	id: varchar({ length: 32 }).notNull(),
	departId: varchar("depart_id", { length: 32 }),
	roleId: varchar("role_id", { length: 32 }),
	permissionId: varchar("permission_id", { length: 32 }),
	dataRuleIds: varchar("data_rule_ids", { length: 1000 }),
	operateDate: datetime("operate_date", { mode: 'string'}),
	operateIp: varchar("operate_ip", { length: 20 }),
},
(table) => [
	index("idx_sdrp_role_per_id").on(table.roleId, table.permissionId),
	index("idx_sdrp_role_id").on(table.roleId),
	index("idx_sdrp_per_id").on(table.permissionId),
	primaryKey({ columns: [table.id], name: "sys_depart_role_permission_id"}),
]);

export const sysDepartRoleUser = mysqlTable("sys_depart_role_user", {
	id: varchar({ length: 32 }).notNull(),
	userId: varchar("user_id", { length: 32 }),
	droleId: varchar("drole_id", { length: 32 }),
},
(table) => [
	index("idx_sdr_user_id").on(table.userId),
	index("idx_sdr_role_id").on(table.droleId),
	primaryKey({ columns: [table.id], name: "sys_depart_role_user_id"}),
]);

export const sysDict = mysqlTable("sys_dict", {
	id: varchar({ length: 32 }).notNull(),
	dictName: varchar("dict_name", { length: 100 }).notNull(),
	dictCode: varchar("dict_code", { length: 100 }).notNull(),
	description: varchar({ length: 255 }),
	delFlag: int("del_flag"),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	type: int().default(0),
	tenantId: int("tenant_id").default(0),
	lowAppId: varchar("low_app_id", { length: 32 }),
},
(table) => [
	index("uk_sd_tenant_id").on(table.tenantId),
	primaryKey({ columns: [table.id], name: "sys_dict_id"}),
	unique("uk_sd_dict_code").on(table.dictCode),
]);

export const sysDictItem = mysqlTable("sys_dict_item", {
	id: varchar({ length: 32 }).notNull(),
	dictId: varchar("dict_id", { length: 32 }),
	itemText: varchar("item_text", { length: 100 }).notNull(),
	itemValue: varchar("item_value", { length: 100 }).notNull(),
	itemColor: varchar("item_color", { length: 10 }),
	description: varchar({ length: 255 }),
	sortOrder: int("sort_order"),
	status: int(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_sditem_role_dict_id").on(table.dictId),
	index("idx_sditem_role_sort_order").on(table.sortOrder),
	index("idx_sditem_status").on(table.status),
	index("idx_sditem_dict_val").on(table.dictId, table.itemValue),
	primaryKey({ columns: [table.id], name: "sys_dict_item_id"}),
]);

export const sysFiles = mysqlTable("sys_files", {
	id: varchar({ length: 32 }).notNull(),
	fileName: varchar("file_name", { length: 255 }),
	url: varchar({ length: 1000 }),
	fileType: varchar("file_type", { length: 20 }),
	storeType: varchar("store_type", { length: 20 }),
	parentId: varchar("parent_id", { length: 32 }),
	tenantId: varchar("tenant_id", { length: 100 }),
	fileSize: double("file_size", { precision: 13, scale: 2 }),
	izFolder: varchar("iz_folder", { length: 2 }),
	izRootFolder: varchar("iz_root_folder", { length: 2 }),
	izStar: varchar("iz_star", { length: 2 }),
	downCount: int("down_count"),
	readCount: int("read_count"),
	shareUrl: varchar("share_url", { length: 255 }),
	sharePerms: varchar("share_perms", { length: 2 }),
	enableDown: varchar("enable_down", { length: 2 }),
	enableUpdat: varchar("enable_updat", { length: 2 }),
	delFlag: varchar("del_flag", { length: 2 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("index_tenant_id").on(table.tenantId),
	index("index_del_flag").on(table.delFlag),
	primaryKey({ columns: [table.id], name: "sys_files_id"}),
]);

export const sysFillRule = mysqlTable("sys_fill_rule", {
	id: varchar({ length: 32 }).notNull(),
	ruleName: varchar("rule_name", { length: 100 }),
	ruleCode: varchar("rule_code", { length: 100 }),
	ruleClass: varchar("rule_class", { length: 100 }),
	ruleParams: varchar("rule_params", { length: 200 }),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_fill_rule_id"}),
	unique("uk_sfr_rule_code").on(table.ruleCode),
]);

export const sysFormFile = mysqlTable("sys_form_file", {
	id: varchar({ length: 32 }).notNull(),
	tableName: varchar("table_name", { length: 50 }).notNull(),
	tableDataId: varchar("table_data_id", { length: 32 }).notNull(),
	fileId: varchar("file_id", { length: 32 }),
	fileType: varchar("file_type", { length: 20 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
},
(table) => [
	index("idx_table_form").on(table.tableName, table.tableDataId),
	index("index_file_id").on(table.fileId),
	primaryKey({ columns: [table.id], name: "sys_form_file_id"}),
]);

export const sysGatewayRoute = mysqlTable("sys_gateway_route", {
	id: varchar({ length: 36 }).notNull(),
	routerId: varchar("router_id", { length: 50 }),
	name: varchar({ length: 64 }),
	uri: varchar({ length: 32 }),
	predicates: text(),
	filters: text(),
	retryable: int(),
	stripPrefix: int("strip_prefix"),
	persistable: int(),
	showApi: int("show_api"),
	status: int(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	delFlag: int("del_flag"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_gateway_route_id"}),
]);

export const sysLog = mysqlTable("sys_log", {
	id: varchar({ length: 32 }).notNull(),
	logType: int("log_type"),
	logContent: longtext("log_content"),
	operateType: int("operate_type"),
	userid: varchar({ length: 32 }),
	username: varchar({ length: 100 }),
	ip: varchar({ length: 100 }),
	method: varchar({ length: 1000 }),
	requestUrl: varchar("request_url", { length: 255 }),
	requestParam: longtext("request_param"),
	requestType: varchar("request_type", { length: 10 }),
	costTime: bigint("cost_time", { mode: "number" }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	tenantId: int("tenant_id"),
	clientType: varchar("client_type", { length: 5 }),
},
(table) => [
	index("idx_sl_userid").on(table.userid),
	index("idx_sl_log_type").on(table.logType),
	index("idx_sl_operate_type").on(table.operateType),
	index("idx_sl_create_time").on(table.createTime),
	primaryKey({ columns: [table.id], name: "sys_log_id"}),
]);

export const sysPermission = mysqlTable("sys_permission", {
	id: varchar({ length: 32 }).notNull(),
	parentId: varchar("parent_id", { length: 32 }),
	name: varchar({ length: 255 }),
	url: varchar({ length: 255 }),
	component: varchar({ length: 255 }),
	isRoute: tinyint("is_route").default(1),
	componentName: varchar("component_name", { length: 255 }),
	redirect: varchar({ length: 255 }),
	menuType: int("menu_type"),
	perms: varchar({ length: 255 }),
	permsType: varchar("perms_type", { length: 10 }).default('0'),
	sortNo: double("sort_no", { precision: 8, scale: 2 }),
	alwaysShow: tinyint("always_show"),
	icon: varchar({ length: 255 }),
	isLeaf: tinyint("is_leaf"),
	keepAlive: tinyint("keep_alive"),
	hidden: tinyint().default(0),
	hideTab: tinyint("hide_tab"),
	description: varchar({ length: 255 }),
	createBy: varchar("create_by", { length: 255 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 255 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	delFlag: int("del_flag").default(0),
	ruleFlag: int("rule_flag").default(0),
	status: varchar({ length: 2 }),
	internalOrExternal: tinyint("internal_or_external"),
},
(table) => [
	index("index_menu_type").on(table.menuType),
	index("index_menu_hidden").on(table.hidden),
	index("index_menu_status").on(table.status),
	index("index_menu_del_flag").on(table.delFlag),
	index("index_menu_url").on(table.url),
	index("index_menu_sort_no").on(table.sortNo),
	primaryKey({ columns: [table.id], name: "sys_permission_id"}),
]);

export const sysPermissionDataRule = mysqlTable("sys_permission_data_rule", {
	id: varchar({ length: 32 }).notNull(),
	permissionId: varchar("permission_id", { length: 32 }),
	ruleName: varchar("rule_name", { length: 50 }),
	ruleColumn: varchar("rule_column", { length: 50 }),
	ruleConditions: varchar("rule_conditions", { length: 50 }),
	ruleValue: varchar("rule_value", { length: 300 }),
	status: varchar({ length: 3 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
},
(table) => [
	index("idx_spdr_permission_id").on(table.permissionId),
	primaryKey({ columns: [table.id], name: "sys_permission_data_rule_id"}),
]);

export const sysPosition = mysqlTable("sys_position", {
	id: varchar({ length: 32 }).notNull(),
	code: varchar({ length: 100 }),
	name: varchar({ length: 100 }),
	postRank: varchar("post_rank", { length: 2 }),
	companyId: varchar("company_id", { length: 255 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 50 }),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_position_id"}),
	unique("uniq_code").on(table.code),
]);

export const sysQuartzJob = mysqlTable("sys_quartz_job", {
	id: varchar({ length: 32 }).notNull(),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	delFlag: int("del_flag"),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	jobClassName: varchar("job_class_name", { length: 255 }),
	cronExpression: varchar("cron_expression", { length: 255 }),
	parameter: varchar({ length: 255 }),
	description: varchar({ length: 255 }),
	status: int(),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_quartz_job_id"}),
]);

export const sysRole = mysqlTable("sys_role", {
	id: varchar({ length: 32 }).notNull(),
	roleName: varchar("role_name", { length: 200 }),
	roleCode: varchar("role_code", { length: 100 }).notNull(),
	description: varchar({ length: 255 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	index("idx_sysrole_tenant_id").on(table.tenantId),
	primaryKey({ columns: [table.id], name: "sys_role_id"}),
	unique("uniq_sys_role_role_code").on(table.roleCode),
]);

export const sysRoleIndex = mysqlTable("sys_role_index", {
	id: varchar({ length: 32 }).notNull(),
	roleCode: varchar("role_code", { length: 50 }),
	url: varchar({ length: 100 }),
	component: varchar({ length: 255 }),
	isRoute: tinyint("is_route").default(1),
	priority: int().default(0),
	status: varchar({ length: 2 }).default('0'),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
},
(table) => [
	index("idx_sri_role_code").on(table.roleCode),
	index("idx_sri_status").on(table.status),
	index("idx_sri_priority").on(table.priority),
	primaryKey({ columns: [table.id], name: "sys_role_index_id"}),
]);

export const sysRolePermission = mysqlTable("sys_role_permission", {
	id: varchar({ length: 32 }).notNull(),
	roleId: varchar("role_id", { length: 32 }),
	permissionId: varchar("permission_id", { length: 32 }),
	dataRuleIds: varchar("data_rule_ids", { length: 1000 }),
	operateDate: datetime("operate_date", { mode: 'string'}),
	operateIp: varchar("operate_ip", { length: 100 }),
},
(table) => [
	index("idx_srp_role_per_id").on(table.roleId, table.permissionId),
	index("idx_srp_role_id").on(table.roleId),
	index("idx_srp_permission_id").on(table.permissionId),
	primaryKey({ columns: [table.id], name: "sys_role_permission_id"}),
]);

export const sysSms = mysqlTable("sys_sms", {
	id: varchar({ length: 32 }).notNull(),
	esTitle: varchar("es_title", { length: 100 }),
	esType: varchar("es_type", { length: 50 }),
	esReceiver: varchar("es_receiver", { length: 50 }),
	esParam: varchar("es_param", { length: 1000 }),
	esContent: longtext("es_content"),
	esSendTime: datetime("es_send_time", { mode: 'string'}),
	esSendStatus: varchar("es_send_status", { length: 1 }),
	esSendNum: int("es_send_num"),
	esResult: varchar("es_result", { length: 255 }),
	remark: varchar({ length: 500 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_ss_es_type").on(table.esType),
	index("idx_ss_es_receiver").on(table.esReceiver),
	index("idx_ss_es_send_time").on(table.esSendTime),
	index("idx_ss_es_send_status").on(table.esSendStatus),
	primaryKey({ columns: [table.id], name: "sys_sms_id"}),
]);

export const sysSmsTemplate = mysqlTable("sys_sms_template", {
	id: varchar({ length: 32 }).notNull(),
	templateName: varchar("template_name", { length: 50 }),
	templateCode: varchar("template_code", { length: 32 }).notNull(),
	templateType: varchar("template_type", { length: 1 }).notNull(),
	templateContent: varchar("template_content", { length: 1000 }).notNull(),
	templateTestJson: varchar("template_test_json", { length: 1000 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	useStatus: varchar("use_status", { length: 1 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_sms_template_id"}),
	unique("uk_sst_template_code").on(table.templateCode),
]);

export const sysTableWhiteList = mysqlTable("sys_table_white_list", {
	id: varchar({ length: 32 }).notNull(),
	tableName: varchar("table_name", { length: 100 }),
	fieldName: varchar("field_name", { length: 200 }),
	status: varchar({ length: 10 }).default('1'),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_table_white_list_id"}),
	unique("uniq_sys_table_white_list_table_name").on(table.tableName),
]);

export const sysTenant = mysqlTable("sys_tenant", {
	id: int().notNull(),
	name: varchar({ length: 100 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 100 }),
	beginDate: datetime("begin_date", { mode: 'string'}),
	endDate: datetime("end_date", { mode: 'string'}),
	status: int(),
	trade: varchar({ length: 10 }),
	companySize: varchar("company_size", { length: 10 }),
	companyAddress: varchar("company_address", { length: 100 }),
	companyLogo: varchar("company_logo", { length: 200 }),
	houseNumber: varchar("house_number", { length: 10 }),
	workPlace: varchar("work_place", { length: 100 }),
	secondaryDomain: varchar("secondary_domain", { length: 50 }),
	loginBkgdImg: varchar("login_bkgd_img", { length: 200 }),
	position: varchar({ length: 10 }),
	department: varchar({ length: 10 }),
	delFlag: tinyint("del_flag").default(0),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	applyStatus: int("apply_status"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_tenant_id"}),
]);

export const sysTenantPack = mysqlTable("sys_tenant_pack", {
	id: varchar({ length: 32 }).notNull(),
	tenantId: int("tenant_id"),
	packName: varchar("pack_name", { length: 20 }),
	status: varchar({ length: 1 }),
	remarks: varchar({ length: 100 }),
	createBy: varchar("create_by", { length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	createTime: date("create_time", { mode: 'string' }),
	updateBy: varchar("update_by", { length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	updateTime: date("update_time", { mode: 'string' }),
	packCode: varchar("pack_code", { length: 50 }),
	packType: varchar("pack_type", { length: 10 }).default('custom'),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_tenant_pack_id"}),
]);

export const sysTenantPackPerms = mysqlTable("sys_tenant_pack_perms", {
	id: varchar({ length: 32 }).notNull(),
	packId: varchar("pack_id", { length: 32 }),
	permissionId: varchar("permission_id", { length: 32 }),
	createBy: varchar("create_by", { length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	createTime: date("create_time", { mode: 'string' }),
	updateBy: varchar("update_by", { length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	updateTime: date("update_time", { mode: 'string' }),
},
(table) => [
	index("idx_stpp_pack_id").on(table.packId),
	primaryKey({ columns: [table.id], name: "sys_tenant_pack_perms_id"}),
]);

export const sysTenantPackUser = mysqlTable("sys_tenant_pack_user", {
	id: varchar({ length: 32 }).notNull(),
	packId: varchar("pack_id", { length: 32 }),
	userId: varchar("user_id", { length: 32 }),
	tenantId: int("tenant_id"),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	status: int(),
},
(table) => [
	index("idx_tpu_pack_id").on(table.packId),
	index("idx_tpu_user_id").on(table.userId),
	index("idx_tpu_tenant_id").on(table.tenantId),
	index("idx_tpu_status").on(table.status),
	primaryKey({ columns: [table.id], name: "sys_tenant_pack_user_id"}),
]);

export const sysThirdAccount = mysqlTable("sys_third_account", {
	id: varchar({ length: 32 }).notNull(),
	sysUserId: varchar("sys_user_id", { length: 32 }),
	avatar: varchar({ length: 255 }),
	status: tinyint(),
	delFlag: tinyint("del_flag"),
	realname: varchar({ length: 100 }),
	tenantId: int("tenant_id").default(0),
	thirdUserUuid: varchar("third_user_uuid", { length: 100 }),
	thirdUserId: varchar("third_user_id", { length: 100 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	thirdType: varchar("third_type", { length: 50 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "sys_third_account_id"}),
	unique("uniq_stat_third_type_user_id").on(table.thirdType, table.thirdUserId),
	unique("uniq_sta_third_user_id_third_type").on(table.thirdUserId, table.thirdType, table.tenantId),
	unique("uniq_sta_third_user_uuid_third_type").on(table.thirdUserUuid, table.thirdType, table.tenantId),
]);

export const sysThirdAppConfig = mysqlTable("sys_third_app_config", {
	id: varchar({ length: 32 }).notNull(),
	tenantId: int("tenant_id").default(0).notNull(),
	agentId: varchar("agent_id", { length: 20 }),
	clientId: varchar("client_id", { length: 50 }),
	clientSecret: varchar("client_secret", { length: 100 }),
	thirdType: varchar("third_type", { length: 20 }),
	agentAppSecret: varchar("agent_app_secret", { length: 100 }),
	status: int().default(1),
	createTime: datetime("create_time", { mode: 'string'}),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_stac_tenant_id").on(table.tenantId),
	index("idx_stac_third_type").on(table.thirdType),
	primaryKey({ columns: [table.id], name: "sys_third_app_config_id"}),
]);

export const sysUser = mysqlTable("sys_user", {
	id: varchar({ length: 32 }).notNull(),
	username: varchar({ length: 100 }),
	realname: varchar({ length: 100 }),
	password: varchar({ length: 255 }),
	salt: varchar({ length: 45 }),
	avatar: varchar({ length: 255 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	sex: tinyint(),
	email: varchar({ length: 45 }),
	phone: varchar({ length: 45 }),
	orgCode: varchar("org_code", { length: 64 }),
	status: tinyint(),
	delFlag: tinyint("del_flag"),
	thirdId: varchar("third_id", { length: 100 }),
	thirdType: varchar("third_type", { length: 100 }),
	activitiSync: tinyint("activiti_sync"),
	workNo: varchar("work_no", { length: 100 }),
	telephone: varchar({ length: 45 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	userIdentity: tinyint("user_identity"),
	departIds: varchar("depart_ids", { length: 1000 }),
	clientId: varchar("client_id", { length: 64 }),
	loginTenantId: int("login_tenant_id"),
	bpmStatus: varchar("bpm_status", { length: 2 }),
	zengqingwei: varchar({ length: 45 }),
	zeng: varchar({ length: 45 }),
},
(table) => [
	index("idx_su_status").on(table.status),
	index("idx_su_del_flag").on(table.delFlag),
	index("idx_su_del_username").on(table.username, table.delFlag),
	primaryKey({ columns: [table.id], name: "sys_user_id"}),
	unique("uniq_sys_user_work_no").on(table.workNo),
	unique("uniq_sys_user_username").on(table.username),
	unique("uniq_sys_user_phone").on(table.phone),
	unique("uniq_sys_user_email").on(table.email),
]);

export const sysUserAgent = mysqlTable("sys_user_agent", {
	id: varchar({ length: 32 }).notNull(),
	userName: varchar("user_name", { length: 100 }),
	agentUserName: varchar("agent_user_name", { length: 100 }),
	startTime: datetime("start_time", { mode: 'string'}),
	endTime: datetime("end_time", { mode: 'string'}),
	status: varchar({ length: 2 }),
	createName: varchar("create_name", { length: 50 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateName: varchar("update_name", { length: 50 }),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 50 }),
	sysCompanyCode: varchar("sys_company_code", { length: 50 }),
},
(table) => [
	index("idx_sug_status").on(table.status),
	index("idx_sug_start_time").on(table.startTime),
	index("idx_sug_end_time").on(table.endTime),
	primaryKey({ columns: [table.id], name: "sys_user_agent_id"}),
	unique("uk_sug_user_name").on(table.userName),
]);

export const sysUserDepart = mysqlTable("sys_user_depart", {
	id: varchar("ID", { length: 32 }).notNull(),
	userId: varchar("user_id", { length: 32 }),
	depId: varchar("dep_id", { length: 32 }),
},
(table) => [
	index("idx_sud_user_id").on(table.userId),
	index("idx_sud_dep_id").on(table.depId),
	primaryKey({ columns: [table.id], name: "sys_user_depart_ID"}),
	unique("idx_sud_user_dep_id").on(table.userId, table.depId),
]);

export const sysUserPosition = mysqlTable("sys_user_position", {
	id: varchar({ length: 32 }).notNull(),
	userId: varchar("user_id", { length: 32 }),
	positionId: varchar("position_id", { length: 32 }),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_sup_user_id").on(table.userId),
	index("idx_sup_position_id").on(table.positionId),
	index("idx_sup_user_position_id").on(table.userId, table.positionId),
	primaryKey({ columns: [table.id], name: "sys_user_position_id"}),
]);

export const sysUserRole = mysqlTable("sys_user_role", {
	id: varchar({ length: 32 }).notNull(),
	userId: varchar("user_id", { length: 32 }),
	roleId: varchar("role_id", { length: 32 }),
	tenantId: int("tenant_id").default(0),
},
(table) => [
	index("idx_sur_user_id").on(table.userId),
	index("idx_sur_role_id").on(table.roleId),
	index("idx_sur_user_role_id").on(table.userId, table.roleId),
	primaryKey({ columns: [table.id], name: "sys_user_role_id"}),
]);

export const sysUserTenant = mysqlTable("sys_user_tenant", {
	id: varchar({ length: 32 }).notNull(),
	userId: varchar("user_id", { length: 32 }),
	tenantId: int("tenant_id"),
	status: varchar({ length: 1 }),
	createBy: varchar("create_by", { length: 32 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 32 }),
	updateTime: datetime("update_time", { mode: 'string'}),
},
(table) => [
	index("idx_sut_user_id").on(table.userId),
	index("idx_sut_tenant_id").on(table.tenantId),
	index("idx_sut_user_rel_tenant").on(table.userId, table.tenantId),
	index("idx_sut_status").on(table.status),
	index("idx_sut_userid_status").on(table.userId, table.status),
	primaryKey({ columns: [table.id], name: "sys_user_tenant_id"}),
]);

export const testDemo = mysqlTable("test_demo", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	name: varchar({ length: 200 }),
	sex: varchar({ length: 32 }),
	age: int(),
	descc: varchar({ length: 500 }),
	birthday: datetime({ mode: 'string'}),
	userCode: varchar("user_code", { length: 32 }),
	fileKk: varchar("file_kk", { length: 500 }),
	topPic: varchar("top_pic", { length: 500 }),
	chegnshi: varchar({ length: 300 }),
	ceck: varchar({ length: 32 }),
	xiamuti: varchar({ length: 100 }),
	searchSel: varchar("search_sel", { length: 100 }),
	pop: varchar({ length: 32 }),
	selTable: varchar("sel_table", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_demo_id"}),
]);

export const testEnhanceSelect = mysqlTable("test_enhance_select", {
	id: varchar({ length: 36 }).notNull(),
	province: varchar({ length: 100 }),
	city: varchar({ length: 100 }),
	area: varchar({ length: 100 }),
	createTime: datetime("create_time", { mode: 'string'}),
	createBy: varchar("create_by", { length: 50 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_enhance_select_id"}),
]);

export const testNote = mysqlTable("test_note", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	age: int(),
	sex: varchar({ length: 32 }),
	birthday: datetime({ mode: 'string'}),
	contents: varchar({ length: 500 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	year: date({ mode: 'string' }),
	sheng: varchar({ length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	month: date({ mode: 'string' }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_note_id"}),
]);

export const testOnlineLink = mysqlTable("test_online_link", {
	id: varchar({ length: 32 }).notNull(),
	pid: varchar({ length: 32 }),
	name: varchar({ length: 255 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_online_link_id"}),
]);

export const testOrderCustomer = mysqlTable("test_order_customer", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	sex: varchar({ length: 32 }),
	age: int(),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	orderId: varchar("order_id", { length: 32 }),
	address: varchar({ length: 300 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_order_customer_id"}),
]);

export const testOrderMain = mysqlTable("test_order_main", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	orderCode: varchar("order_code", { length: 32 }),
	orderDate: datetime("order_date", { mode: 'string'}),
	descc: varchar({ length: 100 }),
	xiala: varchar({ length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_order_main_id"}),
]);

export const testOrderProduct = mysqlTable("test_order_product", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	productName: varchar("product_name", { length: 32 }),
	price: double({ precision: 32, scale: 0 }),
	num: int(),
	descc: varchar({ length: 32 }),
	orderFkId: varchar("order_fk_id", { length: 32 }).notNull(),
	proType: varchar("pro_type", { length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_order_product_id"}),
]);

export const testPerson = mysqlTable("test_person", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sex: varchar({ length: 32 }),
	name: varchar({ length: 200 }),
	content: longtext(),
	beDate: datetime("be_date", { mode: 'string'}),
	qjDays: int("qj_days"),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_person_id"}),
]);

export const testShoptypeTree = mysqlTable("test_shoptype_tree", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	typeName: varchar("type_name", { length: 32 }),
	pic: varchar({ length: 500 }),
	pid: varchar({ length: 32 }),
	hasChild: varchar("has_child", { length: 3 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "test_shoptype_tree_id"}),
]);

export const tmpReportData1 = mysqlTable("tmp_report_data_1", {
	monty: varchar({ length: 255 }),
	mainIncome: decimal("main_income", { precision: 10, scale: 2 }),
	total: decimal({ precision: 10, scale: 2 }),
	hisLowest: decimal("his_lowest", { precision: 10, scale: 2 }),
	hisAverage: decimal("his_average", { precision: 10, scale: 2 }),
	hisHighest: decimal("his_highest", { precision: 10, scale: 2 }),
});

export const tmpReportDataIncome = mysqlTable("tmp_report_data_income", {
	bizIncome: varchar("biz_income", { length: 100 }),
	bxJjYongjin: decimal("bx_jj_yongjin", { precision: 10, scale: 2 }),
	bxZxMoney: decimal("bx_zx_money", { precision: 10, scale: 2 }),
	chengbaoGzMoney: decimal("chengbao_gz_money", { precision: 10, scale: 2 }),
	bxGgMoeny: decimal("bx_gg_moeny", { precision: 10, scale: 2 }),
	tbZxMoney: decimal("tb_zx_money", { precision: 10, scale: 2 }),
	neikongZxMoney: decimal("neikong_zx_money", { precision: 10, scale: 2 }),
	total: decimal({ precision: 10, scale: 2 }),
});

export const v3Demo1 = mysqlTable("v3_demo1", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	sex: varchar({ length: 32 }),
	age: int(),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	salary: double({ precision: 10, scale: 2 }),
	cccc: varchar({ length: 1000 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "v3_demo1_id"}),
]);

export const v3Hello = mysqlTable("v3_hello", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	age: int(),
	sex: varchar({ length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	cc: varchar({ length: 1000 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "v3_hello_id"}),
]);

export const v3HelloCopy = mysqlTable("v3_hello_copy", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	name: varchar({ length: 32 }),
	age: int(),
	sex: varchar({ length: 32 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	birthday: date({ mode: 'string' }),
	cc: varchar({ length: 1000 }),
	bm: varchar({ length: 32 }),
	selUser: varchar("sel_user", { length: 32 }),
	pop: varchar({ length: 32 }),
	cc3: varchar({ length: 1000 }),
	aa: varchar({ length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "v3_hello_copy_id"}),
]);

export const wuLiao = mysqlTable("wu_liao", {
	id: varchar({ length: 36 }).notNull(),
	createBy: varchar("create_by", { length: 50 }),
	createTime: datetime("create_time", { mode: 'string'}),
	updateBy: varchar("update_by", { length: 50 }),
	updateTime: datetime("update_time", { mode: 'string'}),
	sysOrgCode: varchar("sys_org_code", { length: 64 }),
	wulName: varchar("wul_name", { length: 32 }),
	wulCode: varchar("wul_code", { length: 32 }),
	pid: varchar({ length: 32 }),
	hasChild: varchar("has_child", { length: 3 }),
	picc: varchar({ length: 500 }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	xingqi: date({ mode: 'string' }),
	// you can use { mode: 'date' }, if you want to have Date as type for this column
	year1: date({ mode: 'string' }),
	fuwenb: varchar({ length: 32 }),
	guanl: varchar({ length: 32 }),
	yonhu: varchar({ length: 32 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "wu_liao_id"}),
]);

export const zqwMem0Ai = mysqlTable("zqw_mem0ai", {
	id: varchar({ length: 255 }).notNull(),
	vaule: varchar({ length: 255 }),
},
(table) => [
	primaryKey({ columns: [table.id], name: "zqw_mem0ai_id"}),
]);
